/*
 * RtmpCasterName.cpp
 *
 *  Created on: 2017年10月23日
 *      Author: terry
 */

#include "RtmpCasterName.h"
#include "RtmpCaster.h"

namespace av
{

RtmpCasterName::RtmpCasterName()
{
}

RtmpCasterName::~RtmpCasterName()
{
}



struct NameEntry
{
    int event;
    const char* name;
};

static NameEntry s_nameEntry[] = {
	{ RTMP_CASTER_CONNECTING, "connecting"},
	{ RTMP_CASTER_CONNECTED, "connected"},
	{ RTMP_CASTER_DISCONNECTED, "disconnected"},
	{ RTMP_CASTER_CONNECT_FAULT, "connect fault" }
};


const char* RtmpCasterName::getEventName(int event)
{
	size_t count = sizeof(s_nameEntry)/sizeof(s_nameEntry[0]);
	for (size_t i = 0; i < count; i ++)
	{
		if (event == s_nameEntry[i].event)
		{
			return s_nameEntry[i].name;
		}
	}
	return "";
}



} /* namespace av */
